import { observable, action, computed } from "mobx";
import { each } from 'lodash';
import * as API from "../../apis/govern";
import { Tools } from 'weaver-mobile';
const { getLabel } = Tools;

export default class governmindStore {
    @observable selectedTab = 'page';
    @observable taskid = '';
    @observable nodeid = '';
    @observable node;
    @observable task = {};
    @observable title = '';
    @observable displayType = '';
    @observable loading = false;
    @observable noRight = false;
    @observable iscurrentnode = true;
    @observable reportType = true;
    @observable hasChild = false;

    @observable layout = '1';

    @observable canSubmit = false;
    @observable canUndo = false;
    @observable visible = false;
    @observable showButtons = true;


    @action init = (params) => {
        this.loading = true;
        this.params = params;
        // this.params = {id:'603'};
        this.initpath();
    }
    @action initpath = () => {
        this.loading = true;
        API.getMindData(this.params).then(result=>this.setPathNode(result.mindMap));
    }
    @action setPathNode = (node) => {
        this.node = node;
        this.loading = false;
    }


}